read text file character by character in c